import { createRouter, createWebHashHistory } from 'vue-router'
import Login from '../views/Login.vue'
import Index from '../views/Index.vue'

import HelloWorld from '../components/HelloWorld.vue'
import FeedbackList from '../views/feedback/FeedbackList.vue'
import StatisticsList from '../views/feedback/StatisticsList.vue'
import StatisticsInfo from '../views/feedback/StatisticsInfo.vue'
import FeedbackInfo from '../views/feedback/FeedbackInfo.vue'
import AssignFeedback from '../views/feedback/AssignFeedback.vue'
import ProvinceItemTotalStatis from '../views/statistics/ProvinceItemTotalStatis.vue'
import AqiDistributeTotalStatis from '../views/statistics/AqiDistributeTotalStatis.vue'
import AqiTrendTotalStatis from '../views/statistics/AqiTrendTotalStatis.vue'
import OtherTotalStatis from '../views/statistics/OtherTotalStatis.vue'

//定义路由配置数组
const routes = [
  // 定义首页路由
  {
    path: '/',// 根路径
    name: 'home', // 路由名称
    component: Login// 渲染 Login 组件
  },{
    // 定义登录页面路由
    path: '/login',// 登录页面路径
    name: 'Login', // 路由名称
    component: Login// 渲染 Login 组件
  },{
    path: '/index',// 索引页面路径
    name: 'Index',// 路由名称
    component: Index,// 渲染 Index 组件
    children: [// 定义子路由
      {
        path: '/index',
        component: HelloWorld
      },{
        path: '/index/feedbackList',
        component: FeedbackList
      },{
        path: '/index/statisticsList',
        component: StatisticsList
      },{
        path: '/index/statisticsInfo',
        component: StatisticsInfo
      },{
        path: '/index/provinceItemTotalStatis',
        component: ProvinceItemTotalStatis
      },{
        path: '/index/aqiDistributeTotalStatis',
        component: AqiDistributeTotalStatis
      },{
        path: '/index/aqiTrendTotalStatis',
        component: AqiTrendTotalStatis
      },{
        path: '/index/otherTotalStatis',
        component: OtherTotalStatis
      },{
        path: '/index/feedbackInfo',
        component: FeedbackInfo
      },{
        path: '/index/assignFeedback',
        component: AssignFeedback
      }
    ]
  }
]
// 创建路由实例，指定历史模式和路由配置
const router = createRouter({
  history: createWebHashHistory(),
  routes
})

// 导出路由实例供其他地方使用
export default router
